gusucode.com > 耐品图片管理系统 标准版A > 耐品图片管理系统 标准版A/Admin_AppPur.asp

    <!--#include file="Admin_ChkPurview.asp"-->
<%
'===============================================================
' 著作权号:中国国家版权局著作权登记号2004SR07385
' 版权所有:深圳市耐品科技开发有限公司 www.naipin.com
' 联系电话:0755-26611119 81234844 81234845
' 联系手机:13316911914
' 联系邮箱:naipin@naipin.com
'===============================================================

dim strFileName,sql,ID,CurrentPage,Action
Action=trim(request("Action")):ID=Trim(Request("ID"))
strFileName = "Admin_AppPur.asp?"
currentPage = Cint(Netout.CheckStr(request.QueryString("page"),1))
if Action="Del" then
	conn.execute "Delete From NT_AppPur Where ID=" & CLng(ID)
	Response.Redirect(Request.ServerVariables("HTTP_REFERER"))
ElseIf Action="Change" Then
	'On Error Resume Next
	GroupID = Clng(request.QueryString("GroupID"))
	Set rs = conn.Execute("select Setting from NT_UserGroup where ID="&GroupID)
	Setting = rs(0)
	Set rs = Nothing
	Conn.Execute("update NT_User Set GroupID="&GroupID&",Setting='"&Setting&"' where ID="&ID)
	Conn.Execute("delete from NT_AppPur where AppUser='"&request.QueryString("UserName")&"'")
	Behind.WriteSuccessMsg "用户权限设置成功!","Admin_AppPur.asp"
	Response.End()
Else
	Set rs = Conn.Execute("select AppUser from Nt_AppPur Order by ID")
	Do While Not rs.eof
		If Conn.Execute("select * from Nt_User where UserName='"&rs(0)&"'").eof Then
			Conn.Execute("delete from Nt_AppPur where AppUser='"&rs(0)&"'")
		End If
		rs.MoveNext
	Loop
	Set rs = Nothing
End If
%>
<html>
<head>
<title>申请权限管理</title>
<script src="Inc/Pop.js"></script>
<script LANGUAGE="javascript">
function ConfirmDel(){
	if(confirm("确定要删除此项目吗?"))
		return true;
	else
		return false;
}
function ChgThis(obj,UserID,UserName){
	if(obj.value!="0")
		this.location.href="Admin_AppPur.asp?Action=Change&ID="+UserID+"&UserName="+UserName+"&GroupID="+obj.value;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
dim rs
Title="申 请 权 限 管 理"
Link="<a href='Admin_Images.asp' class='black'>管理图片</a> | <a href='Admin_Class.asp' class='black'>分类管理</a>&nbsp;|&nbsp;<a href='Admin_SiteConfig.asp' class='black'>系统配置</a>&nbsp;|&nbsp;<a href='Admin_User.asp' class='black'>用户管理</a>"
sql="select * From NT_AppPur order by id desc"
With Behind
	.WriteHtmlHead
	.WriteHtmlTop Title,Link
	.MaxPerPage	 = 18
	.TopPage	 = False
	.BottomPage	 = True
	.SqlRecord	 = sql
	.InitText	 = "个申请"
	.strFileName = strFileName
	.ShowRecord CurrentPage
	.WriteHtmlEnd
End With
Set Netout = Nothing

sub showContent(MaxPerPage)
   	dim i
    i=0
%>
<div id="MouseTip"></div>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
  <tr class="tdbg1"> 
    <td width="126" align="center">用户名</td>
    <td width="241" align="center">申请理由</td>
    <td width="174" align="center">操作</td>
  </tr>
  <%
	do while not rs.eof
		User = rs("AppUser")
		Set rsUser = Conn.Execute("Select ID,GroupID from NT_User where UserName='"&User&"'")
		UserID = rsUser(0)
		GroupID = rsUser(1)&""
		Set rsUser = Nothing
	%>
	  <tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#EBEBEB'"> 
		<td width="126"><%=User%></td>
		<td width="241" align="center" title="<%=Server.HTMLEncode(rs("AppDesc"))%>"><%=Left(rs("AppDesc"),20)%></td>
    <td width="174" align="center">
      <select name="GroupID" onChange="ChgThis(this,<%=UserID%>,'<%=User%>');">
	    <option value="0">==请选择==</option>
        <option value="1">管理员</option>
	  <%Select Case GroupId%>
	  <%Case "2"%>
		<option value="3">高级会员</option>
	  <%Case "3"%>
        <option value="2">摄影师</option>
	  <%Case "4"%>
        <option value="2">摄影师</option>
		<option value="3">高级会员</option>
	  <%End Select%>
      </select> 
      | <a href='?Action=Del&ID=<%=Rs("ID")%>' onclick='return ConfirmDel();' class='black'>删除</a></td>
  </tr>
  <%
	i=i+1
	if i>=MaxPerPage then exit do
	rs.movenext
loop
%>
</table>
<%
end sub
%>